#ifndef __SLAVE_SENSOR_H
#define __SLAVE_SENSOR_H

#include "Util.h"

typedef struct{
	u8 seq;
	u32 checkSeq;
	u32 slaveErrorCount;
	u32 slaveLastErrorCount;
  u32 intervalNum;	
	bool initFlag;
	
	formatTrans16Struct_t pitchCmd;
	formatTrans16Struct_t yawCmd;
	formatTrans16Struct_t pitchRecv[3];
	formatTrans16Struct_t yawRecv[3];
	
} slaveSensorStruct_t;

typedef struct{
	u8 seq;
	u8 bullet_type;
	formatTrans32Struct_t shootSpeed;
	formatTrans16Struct_t shooter_heat0;
	formatTrans16Struct_t shooter_heat1;
	formatTrans16Struct_t maxHP;
	formatTrans16Struct_t remainHP;
	formatTrans32Struct_t masterPitchMotorAngle;
	formatTrans32Struct_t masterYawMotorAngle;
	formatTrans32Struct_t masterPitchAngleRef;
	formatTrans32Struct_t masterYawAngleRef;
	u8 otherRcValue[18];
	u8 otherRcReadly;
	u8 otherMode;
	bool otherSameTargetFlag;
	bool otherEnemyType;
	bool otherFricMoterFlag;
	bool otherAutoMaticFlag;
} controlTransStruct_t;

extern slaveSensorStruct_t slaveSensorData;
extern controlTransStruct_t controlTransData;

void adis16470DataUpdate(void);
void slaveSensorRead(u8 *arraySlaveSensor);
void moduleCommandUpload(void);
void otherControlRead(u8 *arrayOtherControl);
void controlDataUpload(void);
void slaveSensorConfig(void);

#endif
